<?php
class Zax_Module_Data
{
	public function openFile($path,$mode = 'r',$is_hidden = 0)
	{
		global $Zax;
		$acl = $Zax->acl->get($path,'r');
		$writemode = ($mode !== 'r');
		
		if($writemode && !$acl)
		{
			return false;
		}
		
		$filename = ZAX_DATA_PATH.'/'.$path;
		if($writemode && !is_dir(dirname($filename)))
		{
			mkdir(dirname($filename),null,true);
		}
	}
}